/*
 * Spreed WebRTC.
 * Copyright (C) 2013-2015 struktur AG
 *
 * This file is part of Spreed WebRTC.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

.file-info {
  background: $fileinfo-background;
  border: 1px solid $fileinfo-border;
  border-radius: 4px;
  max-width: 170px;
  padding: 1em;
  position: relative;
  text-align: center;

  &.downloader {
    .anim {
      margin-left: -40px;
    }

    .file-info-size {
      margin-bottom: 10px;
    }
  }

  &.downloading {
    .file-info-size {
      border-color: $fileinfo-downloading-size-border;
    }
  }

  > div {
    position: relative;
    z-index: 3;
  }

  .file-info-bg {
    bottom: 0;
    color: $fileinfo-icon-background-color;
    font-size: 20em;
    left: 41px;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: -82px;
    z-index: 2;
  }

  .actions {
    left: 50%;
    margin-left: 10px;
    position: absolute;
    text-align: left;
    top: 14px;
  }

  .uploader {
    // scss-lint:disable NestingDepth
    .file-info-speed {
      bottom: 6px;
    }

    .actions {
      margin-left: 30px;
      opacity: 0;
    }

    .anim {
      margin-left: 0;
    }

    .hovercontrol {
      &:hover .anim {
        margin-left: -50px;
      }

      &:hover .actions {
        margin-left: 0;
        opacity: 1;
      }

      > div {
        transition: all .2s ease-in-out;
      }
    }
  }
}

.is_remote .file-info {
  background: $fileinfo-background-remote;
  border: 1px solid $fileinfo-border-remote;

  .file-info-bg {
    color: $fileinfo-icon-background-color-remote;
    font-size: 20em;
  }
}

.file-info-name {
  font-size: 1.1em;
  margin: .2em 0;
  min-width: 140px;
  padding: 0 .2em;
}

.file-info-size {
  font-size: .8em;
  height: 20px;
  position: relative;

  > span {
    display: block;
    left: 0;
    margin: 0 auto;
    padding: 3px;
    position: absolute;
    right: 0;
    text-shadow: 1px 1px 1px #fff;
    top: 0;
    z-index: 5;
  }

  > div {
    //scss-lint:disable NestingDepth
    bottom: 0;
    box-shadow: none !important;
    left: 0;
    position: absolute;
    top: 0;
    width: 0;
    z-index: 0;

    &.progress-bar {
      opacity: .5;

      &.download {
        opacity: 1;
        z-index: 1;
      }
    }

  }
}

.file-info-speed {
  bottom: 8px;
  font-size: .8em;
  left: 0;
  position: absolute;
  right: 0;
  text-align: center;
}
